import React, { Component } from "react";
import { Button, Layout } from "antd";
import "./shop.less";

const { Header, Footer, Sider, Content } = Layout;
class Shoping extends Component {
  componentDidMount() {
    const { title = "默认值" } = this.props;
    document.title = title;
  }
  render() {
    const { children, showTop, showFooter } = this.props;
    return (
      <>
        <br></br>
        <Layout>
          {showTop && <Header>Header</Header>}
          <Layout>
            <Sider>Sider</Sider>

            <Content>
              {children.con}
              {children.txt}
              <Button type="primary" onClick={children.btnClick}>
                add
              </Button>
              {children.btnClickjj && (
                <Button type="primary" onClick={children.btnClickjj}>
                  minus
                </Button>
              )}
            </Content>
          </Layout>
          {showFooter && <Footer>Footer</Footer>}
        </Layout>
      </>
    );
  }
}

export default Shoping;
